package iohomework;

import java.io.*;

public class CopyDemo02 {
    public static void main(String[] args) throws IOException {
        File file=new File("cxk.jpg");
        FileInputStream fis=new FileInputStream(file);
        FileOutputStream fos=new FileOutputStream("cxkdlq.jpg");
        byte[] data=new byte[1024*20];
        long start=System.currentTimeMillis();
        int len;
        while((len=fis.read(data))!=-1){
            fos.write(data,0,len);
        }
        long end=System.currentTimeMillis();
        System.out.println("复制完毕，耗时"+(end-start)+"ms");
        fis.close();
        fos.close();

    }
}
